<?php
/**
 * Created by PhpStorm.
 * User: Tangyijun
 * Date: 2017/3/20
 * Time: 15:33
 */
namespace app\home\controller;
use app\service\Sms;
class Code extends Base{
    /**
     * @return array
     * 发送验证码
     */
    public function sendCode(){
        $sms = new Sms();
        try{
            self::checkSubmit();
            $post = input('param.');
            $result = $sms->sendCode($post);
        }catch(\Exception $e){
            return json(self::formatResult($e->getCode(),$e->getMessage()));
        }
        return json($result);
    }
}